<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=<?=$this->config->item('charset');?>">
	<title>菜谱上传_<?=$this->config->item('site_name');?></title>
	<link href="<?=base_url('static/css/global.css')?>" rel="stylesheet" type="text/css" media="screen">
	<link href="<?=base_url('static/css/recipe.css')?>" rel="stylesheet" type="text/css" media="screen">
	<script src="<?=path_res('static/js/jquery.js')?>"></script>
	<script src="<?=path_res('static/js/jquery-ui.min.js')?>"></script>
	<script src="<?=path_res('static/js/tempo.min.js')?>"></script>
	<script src="<?=path_res('static/js/functions.js')?>"></script>
	<script src="<?=path_res('static/js/jquery.autocomplete-min.js')?>"></script>
</head>
<script language="javascript">
  g_blnCheckUnload = true;
</script>
<body onbeforeunload="RunOnBeforeUnload()">

<? $this->load->view('header'); ?>

<div id="main" class="clearfix">
        <div class="uptit relative">
            <h1>创建菜谱</h1>
        </div>
        <div id="upwrongtips" class="upwrons hidden">请填写你的菜谱名称(30字以内)</div>
        <form action="<?=site_url($this->uri->uri_string())?>" method="post" name="recipeform" id="recipeform" enctype="multipart/form-data">
        <div class="upfood clearfix">
            <div class="foname pvl libufo">             
            <span class="uptit2">菜谱名称：</span>
            <input id="cook_name" name="cook_name" type="text" maxlength="30" class="upfnam"/>
            <select id="cook_deal" name="cook_deal" class="seleco">
                        <option value="">菜量</option>
                        <option value="1">1人份</option>
                        <option value="2">2人份</option>
                        <option value="3">3人份</option>
                        <option value="9">3人以上</option>
                    </select>
                    <select id="costtime" name="costtime" class="seleco">
                        <option value="">烹饪时间</option>
                        <option value="10分左右">10分钟左右</option>
                        <option value="30分钟左右">30分钟左右</option>
                        <option value="1小时左右">1小时左右</option>
                        <option value="1小时以上">1小时以上</option>
            </select>
            <input id="coverImageUrl" name="coverImageUrl" value="" type="hidden" />
            <input id="coverImageId" name="coverImageId" value="" type="hidden" />
            <input id="purview" name="purview" value="0" type="hidden">
        </div>
        <div class="foicp pvl libufo clearfix">
            <span class="uptit2">菜谱介绍：</span>
            <div class="rory mrl">
                <textarea name="cookStory" class="strtext r3"></textarea>
            </div>
            <div class="sccpp" id="imgUploadNow">
                <div class="icross" id="uploadCookImage">成品图 </div>
                <div class="iload" id="iloading" style="display:none">正在上传…</div>
            </div>
            <div class="sccpp" id="imgUploadSucc" style="display:none;">
                <img id="upCookImageCover" src="" style="cursor:pointer;width:200px; height:200px;" />
                <span class="zpclose"></span>
            </div>
        </div>

        <div class="ingredient pvl clearfix">
            <span class="uptit2">菜谱介绍：</span>
                <div class="moom clearfix">
                    <div class="mct clearfix ptb1510">
                        <span class="liao">材料名称</span>
                        <span class="liang">用量</span>
                    </div>
                    <div class="mct clearfix mbs">
                        <span class="liao"><input type="text" class="liaoext fcbm" name="materials[str][]" value="" /></span>
                        <span class="liang"><input type="text" class="liangext fcbm" name="materials[int][]" value=""  /></span>
                        <a href="javascript:void(0);" class="wrng"></a>
                    </div>
                    <div class="mct clearfix mbs">
                        <span class="liao"><input type="text" class="liaoext fcbm" name="materials[str][]" value="" /></span>
                        <span class="liang"><input type="text" class="liangext fcbm" name="materials[int][]" value="" /></span>
                        <a href="javascript:void(0);" class="wrng"></a>
                    </div>
                    <div class="mct clearfix mbs">
                        <span class="liao"><input type="text" class="liaoext fcbm" name="materials[str][]" value="" /></span>
                        <span class="liang"><input type="text" class="liangext fcbm" name="materials[int][]" value="" /></span>
                        <a href="javascript:void(0);" class="wrng"></a>
                    </div>
                    <div class="mct clearfix mbs">
                        <span class="liao"><input type="text" class="liaoext fcbm" name="materials[str][]" value="" /></span>
                        <span class="liang"><input type="text" class="liangext fcbm" name="materials[int][]" value="" /></span>
                        <a href="javascript:void(0);" class="wrng"></a>
                    </div>
                    <div class="adlan">
                        <a href="javascript:void(0);" id="zhuliao">增加一栏</a>
                    </div>
                </div>    
            </div>

            <div class="fosetp  clearfix">
                <span class="uptit2">操作步骤：</span>
                <div class="nsetps">   
                <div class="nsetp mbm clearfix">
                    <span class="umber rl3">1</span>
                    <span class="bzmw mrs"><textarea name="setpInfos[]" class="steptext fcbm"></textarea></span>
                    <span class="tjbz">
                        <div class="icross2">
                        步骤图
                        </div>
                        <div class="iloading">
                        正在上传…
                        </div>
                    </span>
                    <span class="upimgsucc tjbz mrl" style="display:none;">
                            <img src="" style="width:140px; display:none;"/>
                            <input type="hidden" name="setpImageIds[]" value="" />
                            <input type="hidden" name="setpImages[]" value="" />
                            <span class="reclose" style="display:none;"></span>
                    </span>
                    
                    <span class="sxgj hidden">
                            <a href="javascript:void(0);" class="ic_up"></a>
                            <a href="javascript:void(0);" class="ic_dw"></a>
                            <a href="javascript:void(0);" class="ic_ad"></a>
                            <a href="javascript:void(0);" class="ic_close"></a>
                    </span>                 
                </div>
                <div class="nsetp mbm clearfix">
                    <span class="umber rl3">2</span>
                    <span class="bzmw mrs"><textarea name="setpInfos[]" class="steptext fcbm"></textarea></span>
                    <span class="tjbz">
                        <div class="icross2">
                        步骤图
                        </div>
                        <div class="iloading">
                        正在上传…
                        </div>
                    </span>
                    <span class="upimgsucc tjbz" style="display:none;">
                            <img src="" style="width:140px;display:none;"/>
                            <input type="hidden" name="setpImageIds[]" value="" />
                            <input type="hidden" name="setpImages[]" value="" />
                            <span class="reclose" style="display:none;"></span>
                    </span>
                    
                    <span class="sxgj hidden">
                            <a href="javascript:void(0);" class="ic_up"></a>
                            <a href="javascript:void(0);" class="ic_dw"></a>
                            <a href="javascript:void(0);" class="ic_ad"></a>
                            <a href="javascript:void(0);" class="ic_close"></a>
                    </span>
                </div>
                <div class="nsetp mbm clearfix">
                    <span class="umber rl3">3</span>
                    <span class="bzmw mrs"><textarea name="setpInfos[]" class="steptext fcbm"></textarea></span>
                    <span class="tjbz">
                        <div class="icross2">
                        步骤图
                        </div>
                        <div class="iloading">
                        正在上传…
                        </div>
                    </span>
                    <span class="upimgsucc tjbz" style="display:none;">
                            <img src="" style="width:140px; display:none;"/>
                            <input type="hidden" name="setpImageIds[]" value="" />
                            <input type="hidden" name="setpImages[]" value="" />
                            <span class="reclose" style="display:none;"></span>
                    </span>
                    
                    <span class="sxgj hidden">
                            <a href="javascript:void(0);" class="ic_up"></a>
                            <a href="javascript:void(0);" class="ic_dw"></a>
                            <a href="javascript:void(0);" class="ic_ad"></a>
                            <a href="javascript:void(0);" class="ic_close"></a>
                    </span>
                </div>

                </div>
            </div>
            <div class="ltip pvl clearfix">
                <span class="uptit2">小技巧：</span>
                <textarea name="cooktips" class="tiptext"></textarea>
            </div>
            <div class="tag clearfix">
                <span class="uptit2">添加标签：</span>
                <div class="tagss">
                <div id="cooktagInput" class="tipu mb20 clearfix">
                    <span class="intput"><input type="text"  id="taginfo" name="taginfo" info="upfood" class="intag fcbm" value="" ></span>
                </div>
<!--                 <div class="hotap mb15 clearfix">
                    <span>我的标签:</span>
                                        <a href="javascript:void(0)" class="cooktag" info="upfood">川菜</a>
                </div> -->
                <div class="hotap mb15 clearfix">
                    <span>常用标签:</span>
                                        <a href="javascript:void(0)" class="cooktag" info="upfood">家常菜</a>
                                        <a href="javascript:void(0)" class="cooktag" info="upfood">香</a>
                                        <a href="javascript:void(0)" class="cooktag" info="upfood">甜品</a>
                                        <a href="javascript:void(0)" class="cooktag" info="upfood">粤菜</a>
                                        <a href="javascript:void(0)" class="cooktag" info="upfood">小吃</a>
                                        <a href="javascript:void(0)" class="cooktag" info="upfood">健康食谱</a>
                                        <a href="javascript:void(0)" class="cooktag" info="upfood">烘焙</a>
                                        <a href="javascript:void(0)" class="cooktag" info="upfood">面点</a>
                                        <a href="javascript:void(0)" class="cooktag" info="upfood">西餐</a>
                                        <a href="javascript:void(0)" class="cooktag" info="upfood">素菜</a>
                                        <a href="javascript:void(0)" class="cooktag" info="upfood">主食</a>
                                        <a href="javascript:void(0)" class="cooktag" info="upfood">鲁菜</a>
                                    </div>
                </div>
                </div>
        </div>
<!--         <div class="feinput mtm mb30 clearfix " id="snsBtn">
            <input type="hidden" id="sinatoken" value="0">          <p class="right">
                <a href="/user/share" target="_blank"><span class="ic_chilun mrs"></span>分享设置</a>
            </p>    
            <span class="fwb">同步到：</span>
            <span class="mrm" id="thirdBar">

            </span>
 <input type="hidden" id="bye" value="0">
            <span>    <input name="share[]" type="checkbox" value="riji" class="czl"> 记录到美食日记</span>
        </div> -->
        <div class="fbcaip mb50">
            <button id="uploadCaipuInfo" type="button" class="btnfb fwb" onclick="uploadInfos();">发布</button>
        </div>
    </div>


<script src="<?=path_res('static/js/ajaxUpload.js')?>"></script>
<script src="<?=path_res('static/js/upfood.js')?>"></script>
<script src="<?=path_res('static/js/taginfo.js')?>"></script>
<script language="javascript">
    $(document).ready(function (){
        $("#uploadCaipuInfo").click(function(){
            g_blnCheckUnload = false;
        });
    });
    function RunOnBeforeUnload() {
        if (g_blnCheckUnload) {window.event.returnValue = '亲！您正在上传菜谱，关闭窗口可能会全功尽弃哦！';
        }  
    }
</script>
<? $this->load->view('footer'); ?>